package com.sinosoft.tcmemr.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sinosoft.tcmemr.entity.DiagnoseEntity;
import com.sinosoft.tcmemr.manager.DiagnoseManager;

@Service
public class DiagnoseService {
	
	@Autowired
	private DiagnoseManager diagnosemanager;
	/**
     * 插入诊断信息
     * @param diagnose
     * @return true/false
     */
    public boolean addDiagnose(DiagnoseEntity diagnose){
    	return diagnosemanager.insertSelective(diagnose);
    }
    
    /**
     * 插入诊断信息
     * @param diagnoselist
     * @return true/false
     */
    public boolean addDiagnoseList(List<DiagnoseEntity> diagnoselist){
    	boolean bSuccess = false;
    	try {
    		for(int i=0;i<diagnoselist.size();i++){
    			diagnosemanager.insertSelective(diagnoselist.get(i));
    		}
    		bSuccess = true;
    	}catch(Exception e){
    		e.printStackTrace();
    	}
    	return bSuccess;
    }

}
